#ifndef KEYANDMOUSE_H
#define KEYANDMOUSE_H

#include <QLabel>

class keyAndMouse : public QLabel
{
    Q_OBJECT
public:

    explicit keyAndMouse(QWidget *parent = nullptr);
protected:
    //鼠标进入事件
    void enterEvent(QEvent* event)override;
    //鼠标离开事件
    void leaveEvent(QEvent *event)override;
    //鼠标移动事件
    virtual void mouseMoveEvent(QMouseEvent *ev)override;
    //鼠标按下事件
    virtual void mousePressEvent(QMouseEvent *ev)override;
    //鼠标释放事件
    virtual void mouseReleaseEvent(QMouseEvent *ev)override;

    //键盘按下事件
    virtual void keyPressEvent(QKeyEvent* ev)override;
    //键盘释放事件
    virtual void keyReleaseEvent(QKeyEvent* ev)override;

    //事件分发
    bool event(QEvent *e) override;
signals:

public slots:
};

#endif // KEYANDMOUSE_H
